<!DOCTYPE html>
<html>
  <head>
    <title>我的收藏</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
      <link rel="stylesheet" href="${s.base}/mobile/base/css/weui.min.css">
    <link rel="stylesheet" href="${s.base}/mobile/base/css/jquery-weui.css">
      <link rel="stylesheet" href="${s.base}/mobile/base/css/base.css?123456">
      <link rel="stylesheet" href="${s.base}/mobile/base/css/component.css?123456">
    <style type="text/css">
	 .border-right1{border-right:1px solid #999999;}
    
	 .icon1{width: 10px; height: 10px;vertical-align: -0.15em;overflow: hidden;}
	 .icon2{width: 34px; height: 34px;vertical-align: -0.15em;overflow: hidden;}
	 
	 .xyg-comp-title1{width:91%; padding:20px 4.5%;}
	 .xyg-comp-pic1{width:91%; padding:0px 4.5% 10px 4.5%;}
	 .xyg-comp-pic1 img{width:100%;height:auto;}
	 .xyg-comp-lie5{width:91%; padding:20px 4.5%;}
	 .xyg-comp-lie5 .xyg-comp-item{width:20%; float:left; height:auto;}
	 .xyg-comp-lie5 .xyg-comp-item img{width:auto; height:60px; }
	 .xyg-comp-lie5 .xyg-comp-item .xyg-comp-item-title{width:100%;height:30px; margin-top:5px;}
    </style>
  </head>
  <body>
   <style type="text/css">
   	.xyg-comp-content1{width:91%; padding:25px 4.5%; height:auto;}
	.xyg-comp-content1 .xyg-comp-item{width:100%; height:auto; padding:20px 0px;}
	.xyg-comp-content1 .xyg-comp-item .xyg-comp-item-left{width:40%; height:auto; float:left;}
	.xyg-comp-content1 .xyg-comp-item .xyg-comp-item-left .xyg-comp-item-img{width:100%; height:210px; position:relative; border-radius:5px;}
	.xyg-comp-content1 .xyg-comp-item .xyg-comp-item-left .xyg-comp-item-img img{width:100%; height:100%;border-radius:5px;}
	.xyg-comp-content1 .xyg-comp-item .xyg-comp-item-left .xyg-comp-item-img .xyg-comp-item-img-title{width:auto; height:30px; line-height:30px; padding:5px 20px; position:absolute; left:0px; top:0px; background:#E92333;border-radius:5px;}
	.xyg-comp-content1 .xyg-comp-item .xyg-comp-item-left .xyg-comp-item-share{width:100%; height:34px; line-height:34px; margin-top:20px;}
	.xyg-comp-content1 .xyg-comp-item .xyg-comp-item-right{width:56%; padding-left:4%; height:auto; float:left;}
	.xyg-comp-content1 .xyg-comp-item .xyg-comp-item-right .xyg-comp-item-param{width:100%;height:auto; margin:10px 0px;}
	.xyg-comp-content1 .xyg-comp-item .xyg-comp-item-right .xyg-comp-item-tag{width:100%;height:auto; margin-top:20px;}
	.xyg-comp-content1 .xyg-comp-item .xyg-comp-item-right .xyg-comp-item-tag .xyg-comp-item-tag-title{width:auto;height:1.2rem;line-height:1.2rem; font-size: 22px; color: #999999; background: #f6f7fb; padding: 0px 0.2rem;float: left;margin-right: 0.2rem;}
	.xyg-comp-content1 .xyg-comp-item .xyg-comp-item-right .xyg-comp-item-price{width:100%;height:auto; margin-top:20px;}
	.xyg-comp-content1 .xyg-comp-item .xyg-comp-item-right .xyg-comp-item-wg{width:100%; height:auto; margin-top:20px;}
	.xyg-comp-content1 .xyg-comp-item .xyg-comp-item-right .xyg-comp-item-wg .xyg-comp-item-wg-num{float:left; line-height:40px;}
	.xyg-comp-content1 .xyg-comp-item .xyg-comp-item-right .xyg-comp-item-wg .xyg-comp-item-wg-user{width:auto; height:40px; position:relative; float:right;}
	.xyg-comp-content1 .xyg-comp-item .xyg-comp-item-right .xyg-comp-item-wg .xyg-comp-item-wg-user img{top:0px; width:40px;position:absolute; height:40px; border-radius:20px;}
	.xyg-comp-content1 .xyg-comp-item .xyg-comp-item-right .xyg-comp-item-wg .xyg-comp-item-wg-user .dian{position:absolute; right:0px; top:0px;width:48px; height:50px; border-radius:20px;}
	.xyg-content-item-line-type{ border:1px solid #FF4B5A; color:#FF4B5A; text-align:center; font-size:24px; padding:0px 10px; letter-spacing:3px; border-radius:7px; line-height:40px; float:right;}

   </style>
   <div class="xyg-comp-content1">

   </div>
   <!--热点楼盘-->
   
   <!--底部菜单开始-->
  <div style="width:100%; height:98px;"></div>
     <div class="xyg-comp-bottom3">
         <div class="xyg-comp-bottom-item">
             <a href="javascript:goFistPage('${memberId}')">
                 <img src="${s.base}/mobile/base/images/icon_menu_1.png"/>
                 <div class="xyg-comp-bottom-item-text ">首页</div>
             </a>
         </div>
         <div class="xyg-comp-bottom-item">
             <a href="javascript:goAllCustomerEditPage('${memberId}')">
                 <img src="${s.base}/mobile/base/images/icon_menu_2.png"/>
                 <div class="xyg-comp-bottom-item-text">推荐</div>
             </a>
         </div>
         <div class="xyg-comp-bottom-item">
             <a href="javascript:goMyPage('${memberId}')">
                 <img src="${s.base}/mobile/base/images/icon_menu_3_a.png"/>
                 <div class="xyg-comp-bottom-item-text select-text">我的</div>
             </a>
         </div>
        <div class="clearBoth"></div>
    </div>
    <!--底部菜单结束-->
   
  </body>
  <script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
  <script src="${s.base}/mobile/base/js/jquery-2.1.4.js"></script>
  <script src="${s.base}/mobile/base/js/jquery-weui.js"></script>
  <script src="${s.base}/mobile/base/js/swiper.js"></script>
  <script src="${s.base}/mobile/base/fonts/iconfont.js"></script>
  <script src="${s.base}/mobile/base/js/component.js"></script>
  <script src="${s.base}/mobile/base/js/base.js?123456789000"></script>
  <script type="text/javascript">
  	initXygDpi();

    var memberId='${memberId}';
    var pageNum = 0;
    var pageSize = 5;
    var loading = false;  //状态标记

	$(document).ready(function(e) {
		initDate();

        if (loading) return;
        loading = true;
        sendPost();
    });

	function initDate(){
		$.fn.initXygCompBanner("",".xyg-comp-banner-swiper1",417);
	}

    function sendPost() {
        pageNum++;
        $.fn.postMethodAll("/weChat/hostCollect/page",{'pageNum':pageNum,'pageSize':pageSize,'memberId':memberId},function (result) {
            if (result.data != null && result.data.length > 0) {
                result.data.forEach(function (item,key,mapObj) {
                    var allPriceStr = "暂无";
                    if (item.allPrice != null && item.allPrice != "") {
                        allPriceStr=item.allPrice+"万";
                    }
                    var str='<div class="xyg-comp-item borderBottom">\
                        <div class="xyg-comp-item-left">\
                        <div class="xyg-comp-item-img">\
                        <div class="xyg-comp-item-img-title font-base5-size color2">\
                        '+item.cityName + '-'+ item.areaName+'\
                        </div>\
                        <img src="'+item.itemCoverImage+'"/>\
                        </div>\
                        <div class="xyg-comp-item-share color1 font-base5-size">\
                        <span><svg class="icon2" aria-hidden="true"><use xlink:href="#iconfenxiang"></use></svg></span>&nbsp;&nbsp;我要推荐\
                    </div>\
                    </div>\
                    <div class="xyg-comp-item-right">\
                        <div class="xyg-comp-item-name font-base4-size color3">'+item.itemName+'</div>\
                        <div class="xyg-comp-item-param font-base1-size color1">'+item.minRooms+'-'+item.maxRooms+'室&nbsp;|&nbsp;'+item.minApartmentArea+'-'+item.maxApartmentArea+'m2\
                    <div class="font-base4-size-bold floatR color4">'+allPriceStr+'</div> \
                    </div>\
                    <div class="xyg-comp-item-tag">';

                    if(item.tag!=null&&item.tag!=""&&item.tag!="null"){
                        var tags=item.tag.split(",");
                        for(var i=0;i<tags.length;i++){
                            str+='<div class="xyg-comp-item-tag-title">'+tags[i]+'</div>';
                        }
                    }
                    str+='<div class="clearBoth"></div>\
                        </div>\
                        <div class="xyg-comp-item-price font-base1-size color1">\
                        均价<span class="font-base3-size-bold color4">'+item.price+'</span>元/m2\
                    </div>\
                    <div class="xyg-comp-item-wg color1 font-base5-size">\
                        <div class="xyg-comp-item-wg-num color5 font-base5-size">楼盘佣金:'+item.shareMoney+'元/套</div>\
                    <div class="xyg-content-item-line-type" onclick="cancelCollect(\''+item.id+'\')">取消收藏</div>\
                        </div>\
                        </div>\
                        <div class="clearBoth"></div>\
                        </div>';
                    $(".xyg-comp-content1").append(str);
                });
                loading = false;
                if (!result.hasNextPage) {
                    $(document.body).destroyInfinite();
                }
            } else {
                $(document.body).destroyInfinite();
            }
            if(result.count<=0){
                $(".xyg-comp-content1").html('<div style="width: 100%; height: auto; line-height: 50px; text-align: center; margin-top: 150px; color: #0A0A0A; font-size: 32px;">'+
                    '<img src="${s.base}/mobile/base/images/no.png" style="width: 350px; height: auto; margin: 10px auto;"/>'+
                    '暂无数据</div>');
            }
        });
    }

    function cancelCollect(id){
	    // 取消收藏
        $.confirm("您确定要取消收藏该信息吗？", "取消收藏提示", function() {
            $.fn.postBase("/weChat/hostCollect/cancelCollect",{'id':id},function (result) {
                if (result.code === 0) {
                    //操作成功
                    $.alert("取消收藏成功！",function () {
                        window.location.reload();
                    });
                } else {
                    //操作失败
                    $.toast(result.msg, "text");
                }
            });
        }, function() {
            //取消操作
            //$(this).removeAttr("checked");
        });
    }

  </script>
  
</html>

